Scott:
I may be wrong but in most systems, the Max following error only tells you when the set error window is exceeded.
It doesn't actually control the following error. Your PID controls your error. Opening up the Max following error
doesn't really introduce more error during cutting.
If you still want to monitor a narrow window for following error:
You could add an input that comes from the light curtain so when the light curtain is broken, this input causes a
widening of your following error window. Once the curtain is back to normal, the following error window goes back to
normal after a small delay time (maybe 0.2 seconds) to allow the axes to reposition and stabilize.
AZ
Group: DynoMotion |
Message: 10825 |
From: Russ Larson |
Date: 1/14/2015 |
Subject: Re: Light Curtain |
Scott: Another option which I use is to disable the stepper driver or servo amplifier and shut down the spindle. If you just disable the controller then it stays in position and never moves and never removes power to the coils so the motor does not move. You would need to restart the spindle to proceed but it would address your concerns. Russ From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] Sent: Tuesday, January 13, 2015 9:00 PM To: DynoMotion@yahoogroups.com; kira.zubar@... Subject: RE: [DynoMotion] Light Curtain Scott: I may be wrong but in most systems, the Max following error only tells you when the set error window is exceeded. It doesn't actually control the following error. Your PID controls your error. Opening up the Max following error doesn't really introduce more error during cutting.
If you still want to monitor a narrow window for following error:
You could add an input that comes from the light curtain so when the light curtain is broken, this input causes a widening of your following error window. Once the curtain is back to normal, the following error window goes back to normal after a small delay time (maybe 0.2 seconds) to allow the axes to reposition and stabilize.
AZ
Group: DynoMotion |
Message: 10826 |
From: cnc_machines |
Date: 1/14/2015 |
Subject: Re: Light Curtain |
Russ,
Thanks for the idea. I am not totally up on safety codes, but I think that the motors have to actually be powered down to allow safe entry. I may be wrong on this, and it is definitely a simple solution.
Scott
|
|
Group: DynoMotion |
Message: 10827 |
From: az@aimele.com |
Date: 1/14/2015 |
Subject: Re: Light Curtain |
Scott, Russ,
If your intent is for maximum safety when the light curtain is blocked then disabling the stepper may not be enough.
Disabling the stepper drive is a more convenient way of preventing motion but it may not be safe enough unless the
disable on the drive is designed to be a "safe disable". This is a design requirement approved by OSHA and used on
most of the big name variable freq drives and servo drives to make safety interfacing easier. It is a disable
designed so that it guarantees if there is any other failure in the drive that may cause motion, a "safe disable"
will not allow the motion to happen.
Most servo and stepper disables cannot make that claim. i.e. it is possible that with the classic disable, motion may
still occur if there is a failure in the drive.
If your intent is maximum safety then electronically disabling the steppers may not be enough to prevent motion.
AZ
Group: DynoMotion |
Message: 10828 |
From: TK |
Date: 1/14/2015 |
Subject: Re: Light Curtain |
Hi Scott,
AZ is correct that Max Following Error only sets the point where the Axis disables. It has no effect on how well the Axis actually follows. But you still shouldn't increase it because of adding a light curtain that disables the axis.
Since you have encoders you should still know where the axis actually is after any drift. I think If you set the target destination to where the axis actually is when re-enabling the axis there should be no following error fault. You can do this for Axis 0 with:
EnableAxisDest(0,ch0->Position);
If necessary you can also save the previous Destination and perform a move back to that location (before any drift).
HTH Regards TK
Scott, Russ,
If your intent is for maximum safety when the light curtain is blocked then disabling the stepper may not be enough.
Disabling the stepper drive is a more convenient way of preventing motion but it may not be safe enough unless the
disable on the drive is designed to be a "safe disable". This is a design requirement approved by OSHA and used on
most of the big name variable freq drives and servo drives to make safety interfacing easier. It is a disable
designed so that it guarantees if there is any other failure in the drive that may cause motion, a "safe disable"
will not allow the motion to happen.
Most servo and stepper disables cannot make that claim. i.e. it is possible that with the classic disable, motion may
still occur if there is a failure in the drive.
If your intent is maximum safety then electronically disabling the steppers may not be enough to prevent motion.
AZ
Group: DynoMotion |
Message: 10829 |
From: cnc_machines |
Date: 1/14/2015 |
Subject: Re: Light Curtain |
AZ,
This sounds very interesting. Could I ask for a little help with implementation?
I am guessing I would want to add this to the Init program in the loop forever portion of the program. I would be using one of the Kstep inputs to indicate that the light curtain is on. Would it look something like this? I made the changes in bold red. I am still trying to figure out how to wait for 0.2 seconds. Does this look right?
for (;;) // loop forever { WaitNextTimeSlice(); // Service Amplifier disable after no activity for a while if (ch0->Dest != LastX || ch1->Dest != LastY || ch2->Dest != LastZ) { // we moved - enable KStep Amplifers SetBit(45); T0 = Time_sec(); // record the time and position of last motion LastX=ch0->Dest; LastY=ch1->Dest; LastZ=ch2->Dest;
ch0->MaxFollowingError=20; ch1->MaxFollowingError=20; ch2->MaxFollowingError=20; While (readbit(180)) ch0->MaxFollowingError=500; ch1->MaxFollowingError=500; ch2->MaxFollowingError=500; } else { if (Time_sec() > T0 + 10000.0) ClearBit(45); } }
|
|
Group: DynoMotion |
Message: 10830 |
From: cnc_machines |
Date: 1/14/2015 |
Subject: Re: Light Curtain |
Tom,
I missed your message - I was writing my response to AZ when yours came in. I am still figuiring out how to program in C, so I appreciate your help. Would your method best be implemented using code like this?
if (readbit(180)=1) EnableAxisDest(0,ch0->Position) else ResumeCoordinatedMotion();
Thanks,
Scott
|
|
Group: DynoMotion |
Message: 10831 |
From: Tom Kerekes |
Date: 1/14/2015 |
Subject: Re: Light Curtain |
Hi Scott,
It isn't clear to me the scenario you are considering.
I was thinking that after an operator reached in and did something, then the operator would need to actively do something like push a button like "Init" or "Re-Enable" before further operation. Rather than have things constantly and automatically disable and re-enable every time the operator reaches in and out.
Could it work like this?
Regards TK
Group: DynoMotion |
Message: 10832 |
From: cnc_machines |
Date: 1/14/2015 |
Subject: Re: Light Curtain |
Tom, The machine has a cycle time of roughly 4 seconds. The operator is loading/unloading small parts between each cycle as quickly as they can. After the part is loaded they would need to press the "Cycle Start" button. The light curtain is preventing the machine from running a cycle with the operators hands inside of the machine. Loading (Light Curtain Broken)- Hands inside of the machine, motors should be powered down. This is done by the safety relay directly removing power from the KStep Motors, and the Spindle.
- If the cycle start button is pushed, nothing should happen. The controller should not try to start a cycle.
Auto Running (Light Curtain Broken) - Operator reaches in while the machine is cutting a part
- Safety relay powers down the motor drivers
- Faults the machine which would require some form or reset to get it running again.
Does this functionality make sense? If you have suggestions on how this could be implemented it would be very helpful. My current problems are:
- Loading - If the light curtain is broken the motors lose position and the cycle start button will not run the next part
- Breaking light curtain while running - the motors are powered down which causes a following error fault. The motors stop moving, however as soon as the beam is not broken the spindle comes back on. I would like it to fault out all of the axis and the spindle.
Thanks,
Scott
|
|
Group: DynoMotion |
Message: 10835 |
From: Tom Kerekes |
Date: 1/14/2015 |
Subject: Re: Light Curtain |
Hi Scott,
I think that should all be doable. Looks like about 3 issues. Let's do one step at a time and start with making the Curtain "permanently" disable the KFLOP Axes and Turn off the Spindle. How is your Spindle turned off? How Many Axes do you have?
Something like below to check if any axis is disabled and the Curtain Trips then disable all the Axes and turn off the Spindle:
#define CURTAIN_BIT 180 #define SPINDLE_ON_BIT 0
// Curtain Tripped with any axis enabled? if (ReadBit(CURTAIN_BIT)==1 && (ch0->Enable || ch1->Enable || ch2->Enable)) { if (ch0->Enable) DisableAxis(0); // axis still enabled? - Disable it if (ch1->Enable) DisableAxis(1); // axis still enabled? - Disable it if (ch2->Enable) DisableAxis(2); // axis still enabled? - Disable it ClearBit(SPINDLE_ON_BIT); }
See if you can modify that for your system and get it working.
Regards TK
Group: DynoMotion |
Message: 10842 |
From: cnc_machines |
Date: 1/15/2015 |
Subject: Re: Light Curtain |
Tom, I was planning on trying out this code today, but when I powered up the machine it appears that my safety relay (connected to the light curtain) has a sticking contact. I checked the amperage and it is only good for 4 amps, and my spindle and steppers use about 10. I will have to delay testing the code you provided until a new relay comes in. I have been working under the assumption that I need to actually cut power to the motors when the light curtain is active. I believe that the KStep has a pin dedicated to turn the drives on and off. Could I route power to this pin from the relay rather than cutting the entire power supply? I will test your program when I get the new relay. Right now I am using one of the KStep outputs to turn on a relay for the spindle. I will have to check which one. To make your code work I would need to change "0" to the proper bit in the #define SPINDLE_ON_BIT 0 statement. If I understand correctly this will turn everything off if the curtain is broken while running in auto. I will give it a try.
Thanks,
Scott
|
|
Group: DynoMotion |
Message: 10937 |
From: cnc_machines |
Date: 1/27/2015 |
Subject: Re: Light Curtain |
Tom,
I have had a chance to work on this again and would like to revive this thread. I have decided to run the spindle independently of the KFlop with an external selector switch.
This leaves the problem of not faulting the axis when the power is cut and it drifts slightly, and then returning to the position before the drift occurred. Do you have any suggestions on how to do this? Would putting this piece of code into the loop forever portion on the .INIT file keep the position? If you have a suggestion on how to get it to move back to the place it was before motion started it would be very helpful.
if (readbit(180)=1) EnableAxisDest(0,ch0->Position) else ResumeCoordinatedMotion();
Thanks,
Scott
|
|
Group: DynoMotion |
Message: 10941 |
From: Tom Kerekes |
Date: 1/28/2015 |
Subject: Re: Light Curtain |
Hi Scott,
I thought we discussed not automatically re-enabling the axes, but rather when the Operator pushes INIT?
You might add the code below to a loop in your INIT file so that the EStop input will also disable the KFLOP Axis Channels
#define ESTOP_BIT 180
// if ESTOP present disable any enabled Axis ?? if (ReadBit(ESTOP_BIT)) { if (ch0->Enable) DisableAxis(0); // axis still enabled? - Disable it if (ch1->Enable) DisableAxis(1); // axis still enabled? - Disable it if (ch2->Enable) DisableAxis(2); // axis still enabled? - Disable it }
Then to re-enable when the Operator pushes INIT the code below will make sure EStop is still not present, save the last commanded Destination, enable the axis commanded to where it currently is, move back to the last commanded destination, wait until it arrives. The code should be added to your INIT program after all the axes have been configured and before any forever loop. Any other EnableAxis function calls should be removed
#include "KMotionDef.h" #define ESTOP_BIT 180 #define SLOW_SPEED 1000.0 // slow speed to move axes back to where they were
main() { if (!ReadBit(ESTOP_BIT)) // EStop not present? { double LastDest; LastDest=ch0->Dest; // save last commanded EnableAxisDest(0,ch0->Position); // enable axis wherever it is MoveAtVel(0,LastDest,SLOW_SPEED); // move back to last commanded while (!CheckDone(0)) ; // wait until it is there LastDest=ch1->Dest; // save last commanded EnableAxisDest(1,ch1->Position); // enable axis wherever it is MoveAtVel(1,LastDest,SLOW_SPEED); // move back to last commanded while (!CheckDone(1)) ; // wait until it is there LastDest=ch2->Dest; // save last commanded EnableAxisDest(2,ch2->Position); // enable axis wherever it is MoveAtVel(2,LastDest,SLOW_SPEED); // move back to last commanded while (!CheckDone(2)) ; // wait until it is there } }
Additionally the latest test program V4.33k should allow you to assign a program to Cycle Start to automatically re-initialize when Cycle Start Is pushed.
HTH Regards TK
Group: DynoMotion |
Message: 10943 |
From: cnc_machines |
Date: 1/28/2015 |
Subject: Re: Light Curtain |
Tom,
I really appreciate your help on this. I so often get stuck, and you are able to keep things moving.
The operator will be loading/unloading a part every 5 seconds. They will need to press cycle start to execute the CNC program to cut the part. Our safety manager asked that I install a light curtain which would cut power to the drives every time a part was loaded. This would prevent them from accidentally starting the machine with a hand inside. The light curtain operates a safety relay which cuts power to the drives any time it is broken. Under normal operating conditions the curtain should only be broken after the cycle is complete and the machine has returned to a home position.
I am trying to allow loading and cycle start as quickly as possible. I have a physical button for cycle start. With your code below I would need two buttons? One to re-initiate, and another for cycle start? Would V4.33K allow this with a single physical external button?
Thanks!
Scott
|
|
Group: DynoMotion |
Message: 10944 |
From: Tom Kerekes |
Date: 1/28/2015 |
Subject: Re: Light Curtain |
Hi Scott,
Yes. But actually if you are always using an external cycle start button then the code that debounces the button could simply run the re-initialization code before sending the cycle start command to KMotionCNC.
But if you want both the on-screen cycle start and the external cycle start to work the same way then you should use V4.33k and assign the initialization program to the cycle start action.
HTH Regards TK
| | | | | | | |
| | | | | | | |